function [ A ] = constructData1( num )
% construct sphere data
% generate random points on the surface, their velocity toward center
%--------------------------Generate----------------------------%
A = zeros(num,6);
radius = 10;
vel = 1;
velAdd = 10;
velNoise = 0.5;
for i = 1 : num
    randRaw = rand(1,2);
    h = 2 * radius * randRaw(1) - radius;
    d = (radius^2 - h^2)^0.5;
    theta = 2 * pi * randRaw(2);
    A(i,1) = d * cos(theta); % velocity on x label
    A(i,2) = d * sin(theta);
    A(i,3) = h;
    A(i,4) = d * cos(theta) * vel / radius + velAdd + velNoise * rand(1);
    A(i,5) = d * sin(theta) * vel / radius + velNoise * rand(1);
    A(i,6) = h * vel / radius + velNoise * rand(1);
end
A = A';
%----------------------------Plot------------------------------%
% figure(6)
% plot3(A(1,:),A(2,:),A(3,:),'r.');
% figure(7)
% plot3(A(4,:),A(5,:),A(6,:),'b.');

%----------------------------Write------------------------------%\
fid = fopen('G\generate1.txt','wt');
fprintf(fid,'%10.6f%10.6f%10.6f%10.6f%10.6f%10.6f\n',A); % Write A
fclose(fid);
end

